$(document).ready(function(){

	/* Binding a click event handler to the links: */
	$('li#drop a').click(function(e){

		/* Finding the drop down list that corresponds to the current section: */
		var dropDown = $(this).parent().next();

		/* Closing all other drop down sections, except the current one */
		$('.dropdown').not(dropDown).slideUp('slow');
		dropDown.slideToggle('slow');

		/* Preventing the default event (which would be to navigate the browser to the link's address) */
		e.preventDefault();
	})

	$(".toggleMenu").toggle(
        //oneven clicks
        function () {
            $(".menu").animate({
                width: '0'
            }, 210, function () {
                //Animation complete
            });

            $(".toggleMenu").animate({
                left: '0'
            }, 210, function () {
                $(".toggleMenu").html('+');
            });

            $(".content-wrapper").animate({
                margin: '0',
                marginLeft: '30px'
            }, 210, function () {
                //Animation complete
            });
        },
        //even clicks
        function () {
            $(".menu").animate({
                width: '210px'
            }, 210, function () {
                //Animation complete
            });

            $(".toggleMenu").animate({
                left: '210px'
            }, 210, function () {
                $(".toggleMenu").html('-');
            });

            $(".content-wrapper").animate({
                margin: '0 auto',
                marginLeft: '240px'
            }, 210, function () {
                //Animation complete
            });
        }
    );

});